import math
class Direction:
    def __init__(self, name, angle):
        self.name = name
        self.opposite = None
        self.angle = angle
    def __str__ (self):
        return self.name

up = Direction("up", 90)
down = Direction("down", 270)
left = Direction("left", 180)
right = Direction("right", 0)

up.opposite = down
down.opposite = up
left.opposite = right
right.opposite = left